<template>
<div class="xy-page">
  <div v-show="title" class="xy-page-title mgb20 menu-title">
    <xy-breadcrumb class="xy-view-breadcrumb" v-if="subTitle"></xy-breadcrumb>
    <span v-else v-html="title"></span>
    <div class="fr">
      <slot name="btn">
        
      </slot>
    </div>
    <!-- <el-button type="text" v-if="settingContent" class="setting mgl15" @click="$emit('setting')">{{settingContent}}</el-button> -->
    <el-button v-if="titleButtonContent" :type="colorType" class="fr" @click="$emit('add')">{{titleButtonContent}}</el-button>
    <el-button v-if="settingContent" class="setting mgr15" @click="$emit('setting')">{{settingContent}}</el-button>
  </div>
  <slot></slot>
</div>
</template>

<script>
export default {
  name: "Page",
  props: {
    title: String,
    subTitle: String,
    settingContent: String,
    titleButtonContent: String,
    colorType: {
      type: String,
      default: 'success'
    }
  }
};
</script>

<style lang="scss">
.xy-page {
  .xy-page-span-point {
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
    width: 6px;
    height: 6px;
    background-color: #c7c7c7;
    border-radius: 100%;
  }
}
</style>
<style lang="scss" scoped>
@import "../assets/scss/variable.scss";
.xy-page {
  padding: 20px;
  & .xy-view-breadcrumb {
    border-top: 0px solid;
    margin-top: 0;
    padding: 0;
  }
  &-title {
    position: relative;
    .setting {
      float: right;
      background: $xy-color-main;
      color: #fff;
      height: 34px;
      line-height: 10px;
      border: none;
    }
    .add {
      float: right;
    }
  }
}
</style>
